import { computed } from 'vue';

import { useAppConfig } from '@vben/hooks';
import { useAccessStore } from '@vben/stores';

const accessStore = useAccessStore();
const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);

// 上传类型
export const accept = '.jpg,.jpeg,.png,.gif,.svg';

// 上传地址
export const upApi = computed(() => {
  return `${apiURL}/admin/user/oss/upload`;
});

// 头部参数设置
export const headers = computed(() => {
  return {
    authorization: accessStore.accessToken || '',
  };
});
